<script type="text/javascript" src="typo3conf/ext/news_front_edit/Resources/Public/Ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="typo3conf/ext/news_front_edit/Resources/Public/Ueditor/ueditor.all.min.js"></script>
<script type="text/javascript" src="typo3conf/ext/news_front_edit/Resources/Public/Ueditor/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript" src="{f:uri.resource(path:'Javascript/common_mail.js')}"></script>
<div class="form-group form-line">
    <label for="receiver" class="control-label">收件人&nbsp;<font style="color:red" >*&nbsp;</font></label>
    <a href="javascript:void(0)" onclick="aClick()" class="btn btn-xs btn-default">选择</a>&nbsp;
    <a href="javascript:void(0)" onclick="bClick()" class="btn btn-xs btn-default">导入</a>&nbsp;
    <a href="{f:uri.resource(path:'example_mail.xls')}" class="btn btn-xs btn-info" target="_blank">示例</a><span id="filename"></span>
    <f:form.textarea property="receiver" id="" rows="3" placeholder="收件人" class="form-control" value="{mail.receiver}"/>
    <p class="help-block">填写多个收件人时，以英文','隔开，e.g.张三&lt;aa@bb.com&gt;,李四&lt;bb@cc.com&gt;,....</p>
    <p class="help-block" style="color:red">注意: 导入收件人文件时，请导入.xls, .xlsx格式的文件</p>
</div>
<div class="form-group">
    <label class="control-label">邮件模板&nbsp;<font style="color:red" >*&nbsp;</font></label>
    <f:form.select property="attach" options="{emailTemplateArray}" class="form-control" prependOptionLabel="···请选择···" value="{mail.attach}" />
    <p class="help-block">邮件模板ID，传入的模板可在<a href="http://sendcloud.sohu.com/" target="_blank">SendCloud</a>创建</p>
    <p class="help-block" style="color:red">注意: 如果配置的API用户是触发类型, 则只能选择触发类模板发送, 反之亦然</p>
</div>
<div class="form-group">
    <label class="control-label" for="sender" >邮件发送者&nbsp;<font style="color:red" >*&nbsp;</font>
    </label>
    <f:form.textfield property="sender" class="form-control" value="{sendname}" />
</div>
<f:form.hidden property="successRate" value="0" />
<f:form.hidden property="sendStstus" id="sendStstus" />
<f:link.action action="new" id="new_action" ></f:link.action>
<script type="text/javascript"> 
var new_url = $("#new_action").attr('href');
$('#formfile').attr('action',new_url);
var p_timer=setInterval('cFun()',500)   
function aClick () {  
    document.getElementById("imfile").click();
}  
function bClick () {
    document.getElementById("subfile").click();
}

function cFun() {
    if (document.getElementById("imfile").value!='') {
        document.getElementById("filename").innerHTML = document.getElementById("imfile").value;
        document.getElementById("filename").setAttribute("style","margin-left:20px;background: #ddd;padding:2px;") ;
        clearInterval(p_timer);
    }
}
</script> 